/**
 * Created with IntelliJ IDEA
 * Description
 * User: 王杰
 * Date: 2025-05-08
 * Time: 8:46
 */
public class Test {

    // 移位运算符
    public static void main(String[] args) {
        byte a = -1;
        System.out.println(a >>> 1); // 2147483647

        System.out.println(a >> 1); // -1
    }

    // 逻辑运算符
    public static void main2(String[] args) {
        int a = 1;
        int b = 2;
        System.out.println(a > b && a == 1);
        System.out.println(a < b && a == 1);

        // 短路与
        System.out.println(a > b && 10 / 0 == 0);// 不报算数运算错误
    }

    // 字符串变成整数
    public static void main1(String[] args) {
        String s = "123";
        int a = Integer.valueOf(s);
        System.out.println(a + 1);
    }
}

